{{include file="public/header" /}}

<!-- content start -->
<div class="account-pages">
	<div class="wrapper-page">
		<div class="am-text-center">
            <span class="logo">{{$admin_theme_site_name}}</span>
        </div>
        <div class="am-margin-top-lg am-nbfc admin-login">
        	{{if count($admin_login_type) gt 0}}
                <div data-am-widget="tabs" class="am-tabs am-tabs-d2 am-margin-0" data-am-tabs="{noSwipe: 1}">
                    {{if count($admin_login_type) gt 1}}
                        <ul class="am-tabs-nav am-cf">
                            {{if in_array('username', $admin_login_type)}}
                                <li class="am-active"><a href="[data-tab-panel-0]">帐号密码</a></li>
                            {{/if}}
                            {{if in_array('email', $admin_login_type)}}
                                <li class="{{if !in_array('username', $admin_login_type)}}am-active{{/if}}"><a href="[data-tab-panel-2]">邮箱验证码</a></li>
                            {{/if}}
                            {{if in_array('sms', $admin_login_type)}}
                                <li class="{{if !in_array('username', $admin_login_type) and !in_array('email', $admin_login_type)}}am-active{{/if}}"><a href="[data-tab-panel-1]">手机验证码</a></li>
                            {{/if}}
                        </ul>
                    {{/if}}
                    <div class="am-tabs-bd am-padding-bottom-sm">
                        {{if in_array('username', $admin_login_type)}}
                            <div data-tab-panel-0 class="am-tab-panel am-active">
                                <!-- form start -->
                                <form class="am-form form-validation-username" method="post" action="{{:MyUrl('admin/admin/login')}}" request-type="ajax-url" request-value="{{:MyUrl('admin/index/index')}}">
                                    <div class="am-form-group am-form-group-refreshing">
                                        <label>用户名</label>
                                        <input type="text" name="accounts" class="am-radius" placeholder="请输入用户名" pattern="{{:MyConst('common_regex_username')}}" data-validation-message="用户名格式 5~18 个字符（可以是字母数字下划线）" autocomplete="off" required />
                                    </div>

                                    <div class="am-form-group am-form-group-refreshing business-form-block am-margin-top-xs">
                                        <label>登录密码</label>
                                        <div class="am-input-group am-input-group-sm">
                                            <input type="password" name="pwd" class="am-radius" placeholder="请输入登录密码" pattern="{{:MyConst('common_regex_pwd')}}" data-validation-message="密码格式 6~18 个字符" autocomplete="off" required />
                                            <span class="am-input-group-btn">
                                                <button class="am-btn am-btn-default am-radius am-icon-eye eye-submit" type="button"></button>
                                            </span>
                                        </div>
                                    </div>

                                    {{if MyC('admin_login_img_verify_state') eq 1}}
                                        <div class="am-form-group am-form-group-refreshing business-form-block am-margin-top-xs">
                                            <label>验证码</label>
                                            <div class="am-input-group am-input-group-sm">
                                                <input type="text" name="verify" class="am-radius" placeholder="请输入验证码" minlength="4" maxlength="4" data-validation-message="请输入图片验证码" autocomplete="off" required />
                                                <span class="am-input-group-btn">
                                                    <span class="am-btn am-btn-default am-radius am-padding-0 form-verify">
                                                        <img src="{{:MyUrl('admin/admin/adminverifyentry')}}" class="am-radius c-p" id="form-verify-img" onClick="this.src=this.src+'&'+Math.random();" />
                                                        <a href="javascript:;" class="form-verify-tips" onClick="document.getElementById('form-verify-img').src='{{:MyUrl('admin/admin/adminverifyentry')}}&'+Math.random();">更换一张</a>
                                                    </span>
                                                </span>
                                            </div>
                                        </div>
                                    {{/if}}
                                    <div class="am-form-group am-form-group-refreshing am-margin-top-lg">
                                        <input type="hidden" name="type" value="username" />
                                        <button type="submit" class="am-btn am-btn-primary am-btn-block am-radius am-btn-sm btn-loading-example" data-am-loading="{loadingText: '登录中...'}">登录</button>
                                    </div>
                                </form>
                                <!-- form end -->
                            </div>
                        {{/if}}
                        {{if in_array('email', $admin_login_type)}}
                            <div data-tab-panel-2 class="am-tab-panel {{if !in_array('username', $admin_login_type)}}am-active{{/if}}">
                                <!-- form start -->
                                <form class="am-form form-validation-email" method="post" action="{{:MyUrl('admin/admin/login')}}" request-type="ajax-url" request-value="{{:MyUrl('admin/index/index')}}">
                                    <div class="am-form-group am-form-group-refreshing">
                                        <label>电子邮箱</label>
                                        <input type="email" name="accounts" class="am-radius" placeholder="请输入电子邮箱" data-validation-message="电子邮箱格式错误" autocomplete="off" required />
                                    </div>

                                    <div class="am-form-group am-form-group-refreshing business-form-block am-margin-top-xs">
                                        <label>验证码</label>
                                        <div class="am-input-group am-input-group-sm">
                                            <input type="number" name="verify" class="am-radius" placeholder="验证码" min="0" minlength="4" maxlength="4" data-validation-message="验证码格式 4 位数字" autocomplete="off" required />
                                            <span class="am-input-group-btn">
                                                <button class="am-btn am-btn-default am-radius btn-loading-example verify-submit" type="button" data-am-loading="{spinner:'circle-o-notch', loadingText:'发送中...'}" data-url="{{:MyUrl('admin/admin/loginverifysend')}}" data-verify="{{:MyC('common_img_verify_state')}}" data-text="获取验证码" data-send-text="还有 {time} 秒" data-time="{{:MyC('common_verify_interval_time', 30, true)}}" data-form-tag="form.form-validation-email">获取验证码</button>
                                            </span>
                                        </div>
                                    </div>
                                    <div class="am-form-group am-form-group-refreshing am-margin-top-lg">
                                        <input type="hidden" name="type" value="email" />
                                        <button type="submit" class="am-btn am-btn-primary am-btn-block am-radius am-btn-sm btn-loading-example" data-am-loading="{loadingText: '登录中...'}">登录</button>
                                    </div>
                                </form>
                                <!-- form end -->
                            </div>
                        {{/if}}
                        {{if in_array('sms', $admin_login_type)}}
                            <div data-tab-panel-1 class="am-tab-panel {{if !in_array('username', $admin_login_type) and !in_array('email', $admin_login_type)}}am-active{{/if}}">
                                <!-- form start -->
                                <form class="am-form form-validation-sms" method="post" action="{{:MyUrl('admin/admin/login')}}" request-type="ajax-url" request-value="{{:MyUrl('admin/index/index')}}">
                                    <div class="am-form-group am-form-group-refreshing">
                                        <label>手机号码</label>
                                        <input type="text" name="accounts" class="am-radius" placeholder="请输入手机号码" pattern="{{:MyConst('common_regex_mobile')}}" data-validation-message="手机号码格式错误" autocomplete="off" required />
                                    </div>

                                    <div class="am-form-group am-form-group-refreshing business-form-block am-margin-top-xs">
                                        <label>验证码</label>
                                        <div class="am-input-group am-input-group-sm">
                                            <input type="number" name="verify" class="am-radius" placeholder="请输入验证码" min="0" minlength="4" maxlength="4" data-validation-message="验证码格式 4 位数字" autocomplete="off" required />
                                            <span class="am-input-group-btn">
                                                <button class="am-btn am-btn-default am-radius btn-loading-example verify-submit" type="button" data-am-loading="{spinner:'circle-o-notch', loadingText:'发送中...'}" data-url="{{:MyUrl('admin/admin/loginverifysend')}}" data-verify="{{:MyC('common_img_verify_state')}}" data-text="获取验证码" data-send-text="还有 {time} 秒" data-time="{{:MyC('common_verify_interval_time', 30, true)}}" data-form-tag="form.form-validation-sms">获取验证码</button>
                                            </span>
                                        </div>
                                    </div>
                                    <div class="am-form-group am-form-group-refreshing am-margin-top-lg">
                                        <input type="hidden" name="type" value="sms" />
                                        <button type="submit" class="am-btn am-btn-primary am-btn-block am-radius am-btn-sm btn-loading-example" data-am-loading="{loadingText: '登录中...'}">登录</button>
                                    </div>
                                </form>
                                <!-- form end -->
                            </div>
                        {{/if}}

                        <div class="am-padding-horizontal am-nbfc">
                            <a href="https://doc.shopxo.net/article/1/265389860360028160.html" target="_blank" class="text-muted" data-am-popover="{theme: 'danger sm', content: '请联系管理员重置密码', trigger: 'hover focus'}">忘记密码?</a>
                        </div>
                    </div>
                </div>
            {{else /}}
                <div class="am-text-center am-padding-vertical-lg register-close"><i class="am-icon-warning"></i> 暂时关闭了登录</div>
            {{/if}}
        </div>
	</div>
</div>
<!-- content end -->

{{if MyC('common_img_verify_state') eq 1}}
    <!-- verify win start -->
    <div class="am-modal am-modal-no-btn" tabindex="-1" id="verify-win">
        <div class="am-modal-dialog am-radius">
            <div class="am-modal-hd">
                <a href="javascript:;" class="am-close" data-am-modal-close>&times;</a>
            </div>
            <div class="am-modal-bd">
                <div class="base">
                    <input type="text" placeholder="图形验证码" minlength="4" maxlength="4" id="verify-img-value" data-validation-message="请输入有效的图形验证码" class="am-form-field am-radius" />
                    <div class="am-fl">
                        <img src="{{:MyUrl('admin/admin/adminverifyentry')}}" class="am-radius c-p" id="verify-img" onClick="this.src=this.src+'&'+Math.random();" />
                        <a href="javascript:;" class="verify-tips" onClick="document.getElementById('verify-img').src='{{:MyUrl('admin/admin/adminverifyentry')}}&'+Math.random();">看不清换一张</a>
                    </div>
                </div>
                <button type="button" class="am-btn am-btn-secondary am-radius am-btn-sm block m-t-20 btn-loading-example verify-submit-win" data-am-loading="{spinner:'circle-o-notch', loadingText:'发送中...'}" data-win="1">确认</button>
            </div>
        </div>
    </div>
    <!-- verify win end -->
{{/if}}

<!-- 随机背景图片 -->
{{if MyC('admin_login_info_bg_images_rand') eq 1 and !empty($bg_images_list) and is_array($bg_images_list)}}
    <div class="bg-slides">
        {{foreach $bg_images_list as $k=>$v}}
            {{if !empty($v)}}
                <div class="bg-slides-item" style="background-image:url('{{$v}}');{{if $k neq 0}}display:none;{{/if}}"></div>
            {{/if}}
        {{/foreach}}
    </div>
{{/if}}

<!-- 插件扩展数据 start -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
    <div class="plugins-tag">
        <span>plugins_view_admin_login_info</span>
    </div>
{{/if}}
{{if !empty($plugins_view_admin_login_info_data) and is_array($plugins_view_admin_login_info_data)}}
    {{foreach $plugins_view_admin_login_info_data as $hook}}
        {{if is_string($hook) or is_int($hook)}}
            {{$hook|raw}}
        {{/if}}
    {{/foreach}}
{{/if}}
		
<!-- footer -->
{{include file="public/footer" /}}